package objects;

import java.util.ArrayList;

import globals.FreeVector;

import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.geom.Circle;

public class SimpleBallObject extends Collidable{
	public Color selfColor;
	public SimpleBallObject(int xin, int yin, int rin, Color me){
		super(xin, yin, rin);
		selfColor=me;
	}
	public SimpleBallObject(int xin, int yin, int rin, FreeVector dir, Color me){
		super(xin, yin, rin, dir);
		selfColor=me;
	}
	
	public void draw(Graphics g){
		g.setColor(selfColor);
		g.draw(new Circle(x,y,r));
	}
	public void update(ArrayList<Collidable> objects){
		super.update(objects);
		if(direction.getMagnatude()>18){
			direction.setMagnitude(18);
		}
		x+=direction.getX();
		y+=direction.getY();
	}
	public void collide(Collidable B) {
		/*Vector vAdd=this.direction;
		vAdd.sub(B.direction);
		vAdd.setMagnitude(vAdd.getMagnatude()*2);
		this.direction.sub(vAdd);
		B.direction.add(vAdd);
		/**/
	}

}
